package com.ybkj.o2o.zhuanxian.conf;

import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.ybkj.o2o.zhuanxian.filters.ModifyParametersFilter;

/**
 * Created by shine on 2016/12/5.
 */
@Configuration
public class FilterConfig {

	/**
	 * 拦截器注册
	 * 
	 * @return
	 */
	@Bean
	public FilterRegistrationBean myOncePerRequestFilterRegistration() {
		FilterRegistrationBean registration = new FilterRegistrationBean();
		registration.setFilter(new ModifyParametersFilter());
		registration.addUrlPatterns("/*");// 拦截路径
		registration.setName("ModifyParametersFilter");// 拦截器名称
		registration.setOrder(1);// 顺序
		return registration;
	}

}
